<style type="text/css">
    .left-panel {
        float: left;
        width: 75%;
    }
    
    .right-panel {
        float: right;
        width: 20%;
        padding-left: 40px;
    }
</style>

<script type="text/javascript" src="<?php echo Yii::app()->baseUrl ?>/scripts/nicedit/nicEdit.js"></script>
<script type="text/javascript">
bkLib.onDomLoaded(function() {
	new nicEditor({
		//buttonList : ['bold','italic','underline','upload'],
		iconsPath:'<?php echo Yii::app()->baseUrl; ?>/scripts/nicedit/nicEditorIcons.gif',
		uploadURI : '<?php echo Yii::app()->baseUrl; ?>/scripts/nicedit/nicUpload.php', 
	}).panelInstance('description');
});
</script>
<script type="text/javascript" src="<?php echo Yii::app()->baseUrl ?>/scripts/jquery/jquery.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        var status = '<? echo $data['status']; ?>';
        $('#status').val(status);
        
        
        $("#name_err").hide();
        $("#create").click(function(){
            $("#name_err").hide();
            name = $('#name').val();
            if(name == ''){
                $("#name_err").show();
                $("#name").focus();
                return false;
            }
    });
    
    });
 
</script>


<form name="create_form" id="create_form" method="POST" action="?r=gcategory/edit&id=<?php echo $data['id'];?>" enctype="multipart/form-data">
    <div class="left-panel">
        <h3>Thông tin cơ bản</h3><hr />
        <table border="0">
            <tr>
                <td><label for="normal">Tên danh mục</label></td>
            </tr>
            <tr>
                <td>
                    <input name="name" id="name" value="<? echo $data['name'] ?>" type="text" size="70" style="width:397px">
                    <label id="name_err" style="display:none;color:red;">Chưa nhập tên danh mục!</label>
                </td>
            </tr>
        </table>
        <br />
        <label for="normal">Giới thiệu</label>
        <textarea  id="description" name="description" rows="8" style="width: 98%"><?php echo $data['description'];?></textarea>

        <br />

         <span style="clear:left"></span>

         <br /><br />
         <center>
         <button class="btn" id="create" href="#"><span class="icon16 icomoon-icon-cog"></span> Save</button>
         <button class="btn" id="cancel" href="?r=gcategory"><span class="icon16 icomoon-icon-cog"></span> Cancel</button>
         </center>
    </div>
    
    <div class="right-panel">
        <h3>Thông tin liên quan </h3><hr />
        <label for="normal" style="width:240px">Trạng thái</label>
        <select name="status" id="status" style="opacity: 0;">
            <option value="active" selected="selected">Active</option>
            <option value="blocked">Blocked</option>
        </select><br /><br />

    </div>
    <span style="clear: both"></span>
</form>